package com.telnikoff.log;

abstract public class Log 
{
	private static LogWriter writer = new LogWriter()
	{
		@Override
		public void write(LogLevel level, String screenName, Object msg) 
		{
			System.out.println(level.getName() + " - "+ screenName + ": " + msg);
		}
	};

	public static void setLogWriter(LogWriter writer)
	{
		Log.writer = writer;
	}
	
	public static void debug(String screenName, Object msg)
	{
		writer.write(LogLevel.DEBUG, screenName, msg);
	}
	
	public static void info(String screenName, Object msg)
	{
		writer.write(LogLevel.INFO, screenName, msg);
	}
	
	public static void warn(String screenName, Object msg)
	{
		writer.write(LogLevel.WARN, screenName, msg);
	}
	
	public static void fatal(String screenName, Object msg)
	{
		writer.write(LogLevel.FATAL, screenName, msg);
	}
}